home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / c / ExtrasLib.lha / ExtrasLib / Source / Ghost.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-30  |  1.2 KB  |  53 lines

  1. #include <clib/extras_protos.h>
  2. #include <graphics/rpattr.h>
  3. #include <graphics/rastport.h>
  4. #include <graphics/gfxmacros.h>
  5. #include <proto/graphics.h>
  6.  
  7. static UWORD GhostPattern[2] =
  8. {
  9.      0x4444,
  10.      0x1111,
  11. };
  12.  
  13. /****** extras.lib/gui_GhostRect ******************************************
  14. *
  15. *   NAME
  16. *       GhostRect -- Cover a rectangular are with 
  17. *                    a ghosted pattern.
  18. *
  19. *   SYNOPSIS
  20. *       gui_GhostRect(RP, Pen, X0, Y0, X1, Y1)
  21. *
  22. *       void gui_GhostRect(struct RastPort *, ULONG, 
  23. *            WORD, WORD, WORD, WORD); 
  24. *
  25. *   FUNCTION
  26. *       Covers a rectangular area with a ghosted pattern
  27. *       using the specified pen number.
  28. *
  29. *   INPUTS
  30. *       RP - Pointer to a RastPort.
  31. *       Pen - the pen number to use for the pattern.
  32. *       X0 - left edge 
  33. *       Y0 - top edge
  34. *       X1 - right edge
  35. *       Y1 - bottom edge
  36. *
  37. ******************************************************************************
  38. *
  39. */
  40.  
  41. void gui_GhostRect(struct RastPort *RP, ULONG Pen, WORD X0, WORD Y0, WORD X1, WORD Y1)
  42. {
  43.   struct RastPort rp;
  44.  
  45.   rp=*RP;
  46.   SetAPen(&rp,Pen);
  47.   SetDrMd(&rp,JAM1);
  48.   SetAfPt(&rp,GhostPattern,1);
  49.  
  50.   if(X1>=X0 && Y1>=Y0)
  51.     RectFill(&rp,X0,Y0,X1,Y1);
  52. }
  53.